Lambda Lifting: Treansforming Programs to Recursive Equations

نویسنده

  • Thomas Johnsson
چکیده

y Abstract Lambda lifting is a technique for transforming a functional program with local function deenitions, possibly with free variables in the function deenitions, into a program consisting only of global function (combinator) deenitions which will be used as rewrite rules. Diierent ways of doing lambda lifting are presented, as well as reasons for rejecting or selecting the method used in our Lazy ML compiler. An attribute grammar and a functional program implementing the chosen algorithm is given.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Lambda - Dropping : Transforming Recursive Equations into Programswith Block

Lambda-lifting a functional program transforms it into a set of recursive equations. We present the symmetric transformation: lambda-dropping. Lambda-dropping a set of recur-sive equations restores block structure and lexical scope. For lack of scope, recursive equations must carry around all the parameters that any of their callees might possibly need. Both lambda-lifting and lambda-dropping t...

متن کامل

Improved Graph-Based Lambda Lifting

Lambda lifting is a technique for transforming a program with local function definitions into a program consisting only of global function definitions. The best known lambda lifting algorithm computes the minimal set of extraneous parameters needed by each function in O(n) steps by solving a system of set equations which are recursive if the functions in the program are mutually recursive. Mutu...

متن کامل

An Extensional Characterization of Lambda-Lifting and Lambda-Dropping

Lambda-lifting and lambda-dropping respectively transform a blockstructured functional program into recursive equations and vice versa. Lambda-lifting was developed in the early 80’s, whereas lambda-dropping is more recent. Both are split into an analysis and a transformation. Published work, however, has only concentrated on the analysis parts. We focus here on the transformation parts and mor...

متن کامل

Lambda-Lifting in Quadratic Time

Lambda-lifting is a program transformation used in compilers and in partial evaluators and that operates in cubic time. In this article, we show how to reduce this complexity to quadratic time, and we present a flow-sensitive lambda-lifter that also works in quadratic time. Lambda-lifting transforms a block-structured program into a set of recursive equations, one for each local function in the...

متن کامل

Incremental Lambda Lifting: an Exercise in Almost-denotational Semantics

We prove the correctness of incremental lambda-lifting, an optimization that attempts to reduce the closure allocation overhead of higher-order programs by changing the scope of nested procedures. This optimization is invalid in the standard denotational semantics of Scheme, because it changes the storage behavior of the program. Our method consists of giving Scheme a denotational semantics in ...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 1985